<template>
  <div>
      <template>
         <Tabs  @on-click="handleTab"> 
            <TabPane label="公司信息管理" name="CompanyTotal"></TabPane>
            <TabPane label="部门信息管理"  name="DeptTotal"></TabPane>
        </Tabs>
      <component :is="currentTab" keep-alive></component>
    </template>
  </div>
</template>

<script>
import CompanyTotal from "./company_info.vue";
import DeptTotal from "./dept_info.vue";
export default {
  name: "tables_page",
  components: {
   CompanyTotal,
   DeptTotal
  }, 
  data() {
    return {
       currentTab: 'CompanyTotal' // currentTab 用于标识当前触发的子组件
    }
    
  },
  methods: {
    handleTab:function(name){
     this.currentTab = name
    },
  
  },
   
};
</script>

